<template>
  <div>
    <!--<el-input v-model="inputVal" placeholder="请输入汉子"  @input="inputValChange"></el-input>-->
    <el-input type="textarea" placeholder="请输入汉子" v-model="inputVal"  @input="inputValChange" :autosize="{ minRows: 10, maxRows: 20}" show-word-limit/>
    <div style="margin: 20px 0; font-size: 24px">有多少笔画：{{strokeNum}}</div>
  </div>
</template>

<script>
let cnchar = require('cnchar');
let trad = require('cnchar-trad');
cnchar.use(trad);
export default {
  components: {},
  props: [],
  data() {
    return {
      inputVal:'',//输入的汉子
      strokeNum:0,
    };
  },
  mounted() {
    console.log()

  },
  methods: {
    inputValChange(val){
      this.strokeNum=cnchar.stroke(val)
    }
  },
};
</script>

<style lang="scss" scoped></style>
